export default {
    props: {
        _input: {
            required: false,
        },
    },
    data() {
            // @VExportData-Start
            return {
                query: {
                    biz_code: null,
                    owner_id: null,
                    order_type: null,
                    order_biz_type: null,
                    dates: null,
                    item_id: null,
                },
                master: {
                    isChanged: false,
                    selections: [],
                    checkedRows: [],
                    selection: null,
                },
                detail: {
                    isChanged: false,
                    selections: [],
                    checkedRows: [],
                    selection: null,
                },
                vjson: {
                    layout: 'SimpleGrid',
                    toolbar: {
                        xtype: 'toolbar',
                        items: [
                            {
                                xtype: 'button',
                                iconCls: 'element Search',
                                text: '查询',
                                type: 'primary',
                                plain: true,
                                listeners: {
                                    click: '{button1_click}',
                                },
                            },
                        ],
                    },
                    form: [
                        {
                            xtype: 'form',
                            colsOfRow: '4',
                            items: [
                                {
                                    xtype: 'textfield',
                                    fieldLabel: '业务单号',
                                    bind: {
                                        value: '{query.biz_code}',
                                    },
                                },
                                {
                                    xtype: 'combo',
                                    fieldLabel: '货主',
                                    bind: {
                                        value: '{query.owner_id}',
                                    },
                                    dataType: 2,
                                    dataDict: 'OWNER',
                                },
                                {
                                    xtype: 'combo',
                                    fieldLabel: '订单类型',
                                    bind: {
                                        value: '{query.order_type}',
                                    },
                                    dataType: 2,
                                    dataDict: 'orderType',
                                },
                                {
                                    xtype: 'combo',
                                    fieldLabel: '订单业务类型',
                                    bind: {
                                        value: '{query.order_biz_type}',
                                    },
                                    dataType: 2,
                                    dataDict: 'ASN_TYPE',
                                },
                                {
                                    xtype: 'datefield',
                                    type: 'date',
                                    fieldLabel: '订单日期',
                                    bind: {
                                        value: '{query.dates}',
                                    },
                                },
                                {
                                    xtype: 'combogrid',
                                    fieldLabel: '商品',
                                    bind: {
                                        value: '{query.item_id}',
                                    },
                                    widget: 'ItemSearch',
                                    lookup: {
                                        item_id: '{query.item_id}',
                                    },
                                },
                            ],
                            lookup: {},
                        },
                    ],
                    items: [
                        {
                            xtype: 'split',
                            items: [
                                {
                                    items: [
                                        {
                                            xtype: 'aggrid',
                                            pagination: true,
                                            columns: [
                                                {
                                                    dataIndex: 'asn_id',
                                                    header: '预期到货通知单ID',
                                                    xtype: 'aggridcolumn',
                                                    hidden: true,
                                                },
                                                {
                                                    xtype: 'aggridcolumn',
                                                    dataIndex: 'dates',
                                                    header: '日期',
                                                },
                                                {
                                                    dataIndex: 'asn_in_id',
                                                    header: '采购订单ID',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'asn_in_code',
                                                    header: '采购编号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'dates',
                                                    header: '日期',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'owner_id',
                                                    header: '货主ID',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'wh_id',
                                                    header: '仓库ID',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'order_type',
                                                    header: '订单类型',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'order_biz_type',
                                                    header: '订单业务类型',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'supplier_id',
                                                    header: '供应商ID',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'asn_staff',
                                                    header: '采购员',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'business_code',
                                                    header: '业务单据编号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'multiple_receive',
                                                    header: '是否允许多次收货',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'remark',
                                                    header: '备注',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'status',
                                                    header: '订单状态',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf1',
                                                    header: '扩展字段1',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf2',
                                                    header: '扩展字段2',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf3',
                                                    header: '扩展字段3',
                                                    xtype: 'aggridcolumn',
                                                },
                                            ],
                                            heightMode: 'fit',
                                            reference: 'master',
                                            dataSource: {
                                                sqlId: 'queryAllAsn',
                                                method: 'invoke',
                                                params: {
                                                    q: '{query}',
                                                },
                                            },
                                            autoLoad: true,
                                            listeners: {
                                            },
                                        },
                                    ],
                                    xtype: 'splitarea',
                                },
                                {
                                    items: [
                                        {
                                            xtype: 'aggrid',
                                            pagination: true,
                                            columns: [
                                                {
                                                    dataIndex: 'asn_in_id',
                                                    header: '入库订单',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'asn_line_no',
                                                    header: '行号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'item_id',
                                                    header: '商品号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'package_id',
                                                    header: '包装ID',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'qty',
                                                    header: '数量',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot_id',
                                                    header: '批次号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot01',
                                                    header: '批次属性1',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot02',
                                                    header: '批次属性2',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot03',
                                                    header: '批次属性3',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot04',
                                                    header: '批次属性4',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot05',
                                                    header: '批次属性5',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot06',
                                                    header: '批次属性6',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot07',
                                                    header: '批次属性7',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot08',
                                                    header: '批次属性8',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot09',
                                                    header: '批次属性9',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot10',
                                                    header: '批次属性10',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot11',
                                                    header: '批次属性11',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lot12',
                                                    header: '批次属性12',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'lpn',
                                                    header: '容器条码',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'price',
                                                    header: '价格',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'quality',
                                                    header: '质量状态',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'create_by',
                                                    header: '创建人',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'update_by',
                                                    header: '更新人',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'create_at',
                                                    header: '创建时间',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'update_at',
                                                    header: '更新时间',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'order_qty',
                                                    header: '收货数量',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'business_code_line',
                                                    header: '业务单据行号',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'remark',
                                                    header: '备注',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'search_lock',
                                                    header: '查询锁定',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'tuih_resaon',
                                                    header: '退货原因',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'cancel_qty',
                                                    header: '取消数量',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'status',
                                                    header: '订单状态',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf1',
                                                    header: '扩展字段1',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf2',
                                                    header: '扩展字段2',
                                                    xtype: 'aggridcolumn',
                                                },
                                                {
                                                    dataIndex: 'udf3',
                                                    header: '扩展字段3',
                                                    xtype: 'aggridcolumn',
                                                },
                                            ],
                                            heightMode: 'fit',
                                            reference: 'detail',
                                            dataSource: {
                                                sqlId: 'queryAllDetail',
                                                method: 'invoke',
                                                params: {
                                                    parent_ans_id: 'watch:{master.selection.asn_id}:required',
                                                    item_id: 'watch:{query.item_id}',
                                                },
                                            },
                                            lookup: {},
                                        },
                                    ],
                                    xtype: 'splitarea',
                                },
                            ],
                            heightMode: 'fit',
                            direction: 'vertical',
                        },
                    ],
                    isFlex: true,
                },
            }
            //@VExportData-End

        },
    methods: {
        button1_click() {
            this.refs.master.reload();
        },
    },
    computed: {},
    watch: {},
}
